define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'system.forbidden/index',
        add_url: 'system.forbidden/add',
        edit_url: 'system.forbidden/edit',
        delete_url: 'system.forbidden/delete',
        modify_url: 'system.forbidden/modify',
        recovery_url: 'system.forbidden/recovery'
    };

    var Controller = {

        index: function () {

            ea.table.render({
                init: init,
                toolbar : ['refresh'],
                defaultToolbar:['filter', {
                    title: '搜索',
                    layEvent: 'TABLE_SEARCH',
                    icon: 'layui-icon-search',
                    extend: 'data-table-id="' + 'user_group' + '"'
                }],
                cols: [[
                    {type: "checkbox"},
                    // {field: 'Member_Account', minWidth: 80, title: '用户名',search:false},
                    {field: 'account', minWidth: 80, title: '账户',search:false},
                    {field: 'ShuttedUntil', minWidth: 80, title: '过期时间', search: false},
                    {
                        width: 250,
                        title: '操作',
                        templet: ea.table.toolDelete,
                        operat:[
                            [{
                                text: '恢复',
                                url: init.recovery_url,
                                method: 'alert',
                                auth: 'recovery',
                                class: 'layui-btn layui-btn-normal layui-btn-xs',
                                field: 'Member_Account'
                            }],
                        ]
                    }
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
       
        password: function () {
            ea.listen();
        }
    };
    return Controller;
});